Support updating worklist item status via relay connection - #110
Conversation
2aa96ab to
4751951
Compare
4751951 to
0d6706a
Compare
| if updated_item is None: | ||
| return {"status": "error", "message": f"Worklist item '{accession_number}' not found"} | ||
|
|
||
| return {"accession_number": accession_number, "status": "confirmed"} |
There was a problem hiding this comment.
given CreateWorklistItem returns status "created", maybe this should return status "updated"?
There was a problem hiding this comment.
These are the statuses we handle for a relay conversation https://github.com/NHSDigital/dtos-manage-breast-screening/blob/main/manage_breast_screening/gateway/models.py#L9-L14
They end up being persisted on the GatewayAction in Manage.
There was a problem hiding this comment.
Hmm sorry that's not entirely correct.
There's a bit of Manage which looks for created or confirmed statuses coming back in Relay responses, and created is not a valid GatewayActionStatus value nor is exists which may also be returned but is never used.
updated seems like the best option given we use created and exists already.
| current_status = MWLStatus(status) | ||
| previous_status = MWLStatusManager._TRANSITIONS[current_status] | ||
| return previous_status, current_status | ||
| except KeyError: |
There was a problem hiding this comment.
might there also be a ValueError?
We don't want to replay the status we've set on the worklist item, use a CRUD verb.
a9e82b7 to
9904e65
Compare

Description
There's a good chance MPPS will not be used by modalities to progress the state of the worklist item.
We can make this update from Manage as the appointment steps are completed or cancelled.
This PR adds support for making status updates to worklist items over the relay connection.
Jira link
https://nhsd-jira.digital.nhs.uk/browse/DTOSS-12874
Review notes
Review checklist